<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="../jquery.min.js"></script>
    <link rel="stylesheet" href="./pbl/dist/sortable.min.css" />
    <!-- 是jq插件，那么肯定是基于jq的，那么是不是事先引入jq -->
    <!-- <script src="./pbl/dist/sortable.min.js"></script> -->
    <script src="./pbl/dist/sortable.js"></script>
    <script>
      // $(function () {
      //   // console.log(111)
      //   // document.querySelector('#sortable').sortablejs()
      //   // $('#sortable')[0].sortablejs()
      // })
    </script>
    <style>
      #sortable {
        opacity: 1;
      }
      #sortable div {
        background-color: hotpink;
      }

      /* #sortable div:nth-child(2n) {
        height: 200px;
      } */
    </style>
  </head>
  <body>
    <!-- <img src="http://www.htmleaf.com/images/logo.svg" alt="" /> -->
    <!-- <ul>
      <li><a data-sjslink="all"> all </a></li>
      <li><a data-sjslink="food"> food </a></li>
      <li><a data-sjslink="development"> development</a></li>
    </ul> -->
    <div id="sortable" class="sjs-default">
      <div data-sjsel="food">
        <div>hehe</div>
      </div>
      <div data-sjsel="food">2</div>
      <div data-sjsel="food">3</div>
      <div data-sjsel="food">4</div>
      <div data-sjsel="food">5</div>
      <div data-sjsel="food">6</div>
      <div data-sjsel="food">7</div>
      <div data-sjsel="food">8</div>
      <div data-sjsel="food">9</div>
    </div>

    <script>
      for (const div of Array.from($('#sortable > div'))) {
        $(div).css('height', parseInt(Math.random() * 300) + 100 + 'px')
      }

      $('#sortable')[0].sortablejs()
    </script>
  </body>
</html>
